*Replication commands for Blanton et al "Resource Wealth: A "Curse" for Labor Rights?", Comparative POlitical Studies

*Table 1 
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode)
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, fe cluster(ccode)
xtabond2 wri_p lnrentierpc gdplog  kofeconglob lvcrisisdummy leftdpi polity2 popmillion prioconflordinal   lagwri_l lagwri_p, gmm (lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy leftdpi polity2 popmillion prioconflordinal   lagwri_l lagwri_p, eq(level)) twostep ortho pca cluster(ccode)

xtreg wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode)
xtreg wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, fe cluster(ccode)
xtabond2 wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, gmm (lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, eq(level)) twostep ortho pca cluster(ccode)

*Table 2 Mediation Analysis
medeff (regress civsociety lnrentierpc gdplog kofeconglob lvcrisisdummy kofsocglob prioconflordinal lagwri_p lagwri_l) (regress wri_p lnrentierpc civsociety  gdplog kofeconglob lvcrisisdummy polity2 leftdpi popmillion  prioconflordinal lagwri_l lagwri_p), treat(lnrentierpc) mediate(civsociety) vce(cluster ccode) 
medeff (regress laborINGOs lnrentierpc polity2 gdplog kofeconglob lvcrisisdummy kofsocglob prioconflordinal lagwri_p lagwri_l) (regress wri_p lnrentierpc laborINGOs gdplog kofeconglob lvcrisisdummy polity2 leftdpi popmillion prioconflordinal lagwri_l lagwri_p), treat(lnrentierpc) mediate(laborINGOs) vce(cluster ccode)
medeff (regress icrgburqual lnrentierpc polity2 gdplog kofeconglob lvcrisisdummy kofsocglob prioconflordinal) (regress wri_p lnrentierpc icrgburqual gdplog kofeconglob lvcrisisdummy polity2 leftdpi popmillion prioconflordinal lagwri_l lagwri_p), treat(lnrentierpc) mediate(icrgburqual) vce(cluster ccode)

*Figure 1 commands
xtreg wri_p wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal, cluster(ccode)
margins, at((mean) _all lnrentierpc=(0(2)8))
hist lnrentierpc if lnrentierpc<8.001, freq


*** Appendix Tables****
*Table A1 Summary Statistics
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode)
sum wri_p wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy  polity2 leftdpi  popmillion prioconflordinal lagwri_l lagwri_p civsociety laborINGOs icrgburqual if e(sample)

**** Table A2 APPENDIX LOGIT MODELS SEPARATE ANALYSIS
ologit wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy  polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode) nolog
feologit wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy  polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode) nolog
ologit wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy  polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode) nolog
feologit wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy  polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode) nolog

**** Table A3 APPENDIX LESS DEVELOPED COUNTRIES MODELS
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p if oecd==0, cluster(ccode)
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p if oecd==0, fe cluster(ccode)
xtreg wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p if oecd==0, cluster(ccode)
xtreg wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p if oecd==0, fe cluster(ccode)

**** TABLE A4 APPENDIX MODELS CONTROLLING FOR OIL STATE, GULF, AND RESTRICTED GULF MODELS
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal lagwri_l lagwri_p oilstate , cluster(ccode)
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal  lagwri_l lagwri_p gulf, cluster(ccode)
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal lagwri_l lagwri_p if gulf==0, cluster(ccode)
xtreg wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal lagwri_l lagwri_p oilstate, cluster(ccode)
xtreg wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal lagwri_l lagwri_p gulf, cluster(ccode)
xtreg wri_l lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal lagwri_l lagwri_p if gulf==0, cluster(ccode)

****TABLE A5 APPENDIX SEPERATE ANALYSIS FOR DIFFERENT RESOURCE WEALTH****
xtreg wri_p lngasrentspc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, fe cluster(ccode)
xtreg wri_p lnoilrentspc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p,fe  cluster(ccode)
xtreg wri_p lnmineralrentspc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, fe cluster(ccode)
xtreg wri_p lncoalrentspc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, fe cluster(ccode)
xtreg wri_p lnforestryrentspc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, fe cluster(ccode)

****TABLE A6 APPENDIX ROSS/MAHDAVI DATA****
xtreg wri_p lnoilgaspc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode)
xtreg wri_l lnoilgaspc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, cluster(ccode)


*Table A7 Alternative DVs: CIRI Worker Rights and Mosley/UNO
ologit worker lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagworker, cluster(ccode)
sort ccode year
xtreg LaborRightsPos lnrentierpc   gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal l.LaborRightsPos l.LawPos, cluster(ccode)
xtreg LawPos lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   l.LaborRightsPos l.LawPos, cluster(ccode)

****Table A8  APPENDIX PARTIAL MODELS
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, fe cluster(ccode)
xtreg wri_p lnrentierpc if e(sample), fe cluster(ccode)
xtreg wri_p lnrentierpc  gdplog  if e(sample), fe cluster(ccode)
xtreg wri_p lnrentierpc  kofeconglob if e(sample), fe cluster(ccode)
xtreg wri_p lnrentierpc  lvcrisisdummy if e(sample), fe cluster(ccode)
xtreg wri_p lnrentierpc polity2 if e(sample), fe cluster(ccode)
xtreg wri_p lnrentierpc leftdpi if e(sample), fe cluster(ccode)
xtreg wri_p lnrentierpc popmillion if e(sample), fe cluster(ccode)
xtreg wri_p lnrentierpc prioconflordinal if e(sample), fe cluster(ccode)
xtreg wri_p lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, fe cluster(ccode)

*Appendix Table A9 - Models with V-Dem Democracy Variables
xtabond2 wri_p lnrentierpc electdem gdplog  kofeconglob lvcrisisdummy  leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, gmm (lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy electdem leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, eq(level)) twostep ortho pca cluster(ccode)
xtabond2 wri_p lnrentierpc libdem gdplog  kofeconglob lvcrisisdummy leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, gmm (lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy libdem leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, eq(level)) twostep ortho pca cluster(ccode)

xtabond2 wri_l lnrentierpc electdem  gdplog  kofeconglob lvcrisisdummy leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, gmm (lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy electdem leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, eq(level)) twostep ortho pca cluster(ccode)
xtabond2 wri_l lnrentierpc  libdem gdplog  kofeconglob lvcrisisdummy leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, gmm (lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy libdem leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, eq(level)) twostep ortho pca cluster(ccode)


*Appendix Table A10 - V-DEM FORCED LABOR VARIABLES 
xtreg v2xcl_slave lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagslave, cluster(ccode)
xtreg v2xcl_slave lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagslave, fe cluster(ccode)
xtabond2 v2xcl_slave lnrentierpc  gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagslave, gmm (lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagslave, eq(level)) twostep ortho pca cluster(ccode)

*Appendix Table A11 - Model with Democracy as Mediator
medeff (regress polity2 lnrentierpc gdplog kofeconglob lvcrisisdummy kofsocglob prioconflordinal lagwri_p lagwri_l) (regress wri_p lnrentierpc polity2 gdplog kofeconglob lvcrisisdummy leftdpi popmillion prioconflordinal lagwri_l lagwri_p), treat(lnrentierpc) mediate(polity2) vce(cluster ccode)

*Appendix Table A12 - GMM models with Bur Quality variable
xtabond2 wri_p lnrentierpc icrgburqual gdplog  kofeconglob lvcrisisdummy leftdpi polity2 popmillion prioconflordinal   lagwri_l lagwri_p, gmm (icrgburqual lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy leftdpi polity2 popmillion prioconflordinal icrgburqual lnrentierpc  lagwri_l lagwri_p, eq(level)) twostep ortho pca cluster(ccode)
xtabond2 wri_l lnrentierpc icrgburqual gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal   lagwri_l lagwri_p, gmm (icrgburqual lnrentierpc, lag(3 3)) iv (gdplog  kofeconglob lvcrisisdummy polity2 leftdpi  popmillion prioconflordinal icrgburqual lnrentierpc lagwri_l lagwri_p, eq(level)) twostep ortho pca cluster(ccode)
